﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace MyUtility
{
    public partial class ProfilePage : PhoneApplicationPage
    {
        public ProfilePage()
        {
            InitializeComponent();
        }

        private void bnt01_Click(object sender, System.Windows.RoutedEventArgs e)
        {
        	// TODO: Add event handler implementation here.
			if(rd01.IsChecked.Value){
				MessageBox.Show("เลือกแอปเปิ้ล");
			}
			if(chk02.IsChecked.Value){
				MessageBox.Show("เลือกปั่น");
			}
        }

        private void chk02_Checked(object sender, System.Windows.RoutedEventArgs e)
        {
        	// TODO: Add event handler implementation here.
			mySampleVideo.Play();
        }

        private void chk01_Checked(object sender, System.Windows.RoutedEventArgs e)
        {
        	// TODO: Add event handler implementation here.
			mySampleVideo.Pause();
        }

        private void myListBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
        	// TODO: Add event handler implementation here.
			MessageBox.Show(myListBox.SelectedIndex.ToString());
			//MessageBox.Show(myListBox.SelectedItem);
			//MessageBox.Show(myListBox.SelectedItems);
			//MessageBox.Show(myListBox.SelectedValue);
        }

        private void bntList01_Click(object sender, System.Windows.RoutedEventArgs e)
        {
        	// TODO: Add event handler implementation here.
			ListBoxItem lt01 = new ListBoxItem();
			
			StackPanel pn = new StackPanel();
			Button b1 = new Button();
			b1.Content = "Item 01";
			
			Button b2 = new Button();
			b2.Content = "Item 02";
			
			pn.Children.Add(b1);
			pn.Children.Add(b2);
			
			lt01.Content = pn;
			
			myListBox.Items.Add(lt01);
			
        }
    }
}
